package org.wkg.lesson01;

public class Demo02_Thread {

    public static void main(String[] args) {
        Thread thread = new Thread(() -> {

        });

        MyThread2 myThread2 = new MyThread2();
        myThread2.start();
        while (true){
            try {
                Thread.sleep(1000);
                System.out.println("hello main thread....");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }


    }
}


class MyThread2 extends Thread{
    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
                System.out.println("hello run thread....");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

        }
    }
}


